package com.basker.pisces.domain.element.resouce;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.springframework.util.StringUtils;

import com.basker.pisces.core.meta.annotation.DataField;
import com.basker.pisces.core.meta.annotation.DataObjectMeta;

import lombok.Data;

@DataObjectMeta
@Data
public class MetaTypeBuilder {

    @DataField
    private String metaType;

    @DataField
    private String resouces;

    public List<String> getResouceList() {
        if (StringUtils.isEmpty(resouces)) {
            return Collections.emptyList();
        }

        return Arrays.asList(resouces.split(","));
    }

}
